package it.canraid.leaflet.control.activity;

import it.canraid.leaflet.R;
import it.canraid.leaflet.control.Kernel;
import it.canraid.leaflet.control.MessageListAdapter;
import it.canraid.leaflet.model.LinePill;
import it.canraid.leaflet.model.ReadMessagePill;
import it.canraid.leaflet.model.StatusPill;
import it.canraid.leaflet.model.WordPill;

import java.util.ArrayList;

import android.app.ActionBar;
import android.os.Bundle;
import android.widget.ListView;

/**
 * @deprecated
 * 
 * @author evitcam
 * 
 */
public class ListActivityV extends android.support.v4.app.FragmentActivity {

    public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.list_v);
	ActionBar ab = getActionBar();
	ab.hide();

	// myStatusView = (StatusMessageView) findViewById(R.id.myStatusView);
	Kernel.R().readMessageAdapter = new MessageListAdapter(this, R.layout.item_v);
	ListView listReadMessage = (ListView) findViewById(R.id.readMessageList);
	listReadMessage.setAdapter(Kernel.R().readMessageAdapter);

	ArrayList<ReadMessagePill> messageList = new ArrayList<ReadMessagePill>();
	for (int yu = 0; yu < 15; yu++) {
	    LinePill l1 = new LinePill(10, 10, 20, 20);
	    LinePill l2 = new LinePill(20, 20, 40, 40);
	    LinePill l3 = new LinePill(40, 40, 80, 80);
	    ArrayList<LinePill> arrLine = new ArrayList<LinePill>();
	    arrLine.add(l1);
	    arrLine.add(l2);
	    arrLine.add(l3);

	    WordPill w1 = new WordPill("ciao1", 10, 20);
	    WordPill w2 = new WordPill("ciao2", 10, 40);
	    WordPill w3 = new WordPill("ciao3", 10, 80);
	    ArrayList<WordPill> arrWord = new ArrayList<WordPill>();
	    arrWord.add(w1);
	    arrWord.add(w2);
	    arrWord.add(w3);

	    StatusPill status = new StatusPill("Descrizione: " + yu);

	    ReadMessagePill msg = new ReadMessagePill(arrWord, arrLine, status);
	    messageList.add(msg);
	}
	Kernel.R().readMessageAdapter.set(messageList);
    }

}